package oop7;

/**
 * @author oldliu
 * @since 1.0
 */
public class Cycle {
    //不合适的
    public static final double pi = 3.14;
    private double r;
    public Cycle(double r){
        this.r=r;
    }
    public double areas(){
        double area = r * r * pi;
        return area;
    }
    public double perimeters(){
        double perimeter = r * 2 * pi;
        return perimeter;
    }
    public static void main(String[] args) {
        //pi=3.4;//错误
        // double perimeters = perimeters();
        Cycle c=new Cycle(10.5);
        //c.pi=3.1;
        double areas = c.areas();
        System.out.println(areas);
    }
}
